<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>函数提升优先级高</title>
</head>
<body>
<script>
    foo();
    var a=true;
    if(a){
        function foo(){
            console.log('a');
        }
    }else{
        function foo(){
            console.log('b');
        }
    }
</script>
</body>
</html>